<%@ page contentType="text/html;charset=UTF-8"%>
<!-- 引入标签库 -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
    
<html>
<head>
	<title>用户信息维护</title>
	<!-- 包含公共资源 -->
	<%@ include file="/commons/meta.jsp" %>
	<%@ include file="/commons/meta-easyui.jsp" %>
	<%@ include file="/commons/meta-simpletable.jsp" %>
	<script type="text/javascript">
		function toAdd(){
			$("#queryForm").attr('action',"${ctx}/Userinfo/create.do");
			$("#queryForm").submit();
		}
	</script>
</head>
<body>
<%@include file="/commons/messages.jsp" %>
	<form id="queryForm" name="queryForm" method="post" action="${ctx}/Userinfo/list.do" style="display: inline;">
	<!-- 搜索区域 -->
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>	
					<td class="tdLabel">用户名</td>		
					<td>
						<input value="${query.username}" id="username" name="username"  />
					</td>
					<td class="tdLabel">密码</td>		
					<td>
						<input value="${query.pwd}" id="pwd" name="pwd"  />
					</td>
					<td class="tdLabel">电子邮件</td>		
					<td>
						<input value="${query.email}" id="email" name="email"  />
					</td>
					<td class="tdLabel">真实姓名</td>		
					<td>
						<input value="${query.realname}" id="realname" name="realname"  />
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">性别</td>		
					<td>
						<input value="${query.gender}" id="gender" name="gender"  />
					</td>
					<td class="tdLabel">密保问题</td>		
					<td>
						<input value="${query.question}" id="question" name="question"  />
					</td>
					<td class="tdLabel">密保答案</td>		
					<td>
						<input value="${query.answer}" id="answer" name="answer"  />
					</td>
					<td class="tdLabel">电话号码</td>		
					<td>
						<input value="${query.phone}" id="phone" name="phone"  />
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">个人主页</td>		
					<td>
						<input value="${query.mypage}" id="mypage" name="mypage"  />
					</td>
					<td class="tdLabel">爱好</td>		
					<td>
						<input value="${query.hobbies}" id="hobbies" name="hobbies"  />
					</td>
					<td class="tdLabel">自我介绍</td>		
					<td>
						<input value="${query.selfintro}" id="selfintro" name="selfintro"  />
					</td>
				</tr>	
				<tr>
					<td> 
					<a href="javascript:;" class="easyui-linkbutton"
						iconCls="icon-search" 
						onclick="getReferenceForm(this).submit();">搜索</a>
					</td>
				</tr>			
			</table>
		</fieldset>
		<!-- 新增和删除按钮 -->		
		<div class="handleControl" style="margin: 10px 0;">
				<a href="javascript:;" onclick="toAdd();" class="easyui-linkbutton" iconCls="icon-add">新增</a>
				<a href="javascript:;" 
				onclick="batchDelete('${ctx}/Userinfo/delete.do','items','queryForm');" 
				class="easyui-linkbutton" iconCls="icon-remove" >删除</a>
		<div>
	
	</div>
	<!-- 搜索区域  结束-->
	<!-- 数据区域 -->
	<div class="gridTable">
		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>
			  
			  <tr>
				<th style="width:1px;"> </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>
				
				<th sortColumn="USERNAME" >用户名</th>
				<th sortColumn="PWD" >密码</th>
				<th sortColumn="EMAIL" >电子邮件</th>
				<th sortColumn="REALNAME" >真实姓名</th>
				<th sortColumn="GENDER" >性别</th>
				<th sortColumn="QUESTION" >密保问题</th>
				<th sortColumn="ANSWER" >密保答案</th>
				<th sortColumn="PHONE" >电话号码</th>
				<th sortColumn="MYPAGE" >个人主页</th>
				<th sortColumn="HOBBIES" >爱好</th>
				<th sortColumn="SELFINTRO" >自我介绍</th>
	
				<th>操作</th>
			  </tr>
			  
		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="userinfo" varStatus="status">
		  	  
			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
			  	<!-- 序号 -->
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<!-- 复选框 -->
				<td><input type="checkbox" name="items" value="${userinfo.id}"></td>
				<!-- 从第三列开始 是真正的数据 用el表达式取每个对象的每个属性 -->
				<td><c:out value='${userinfo.username}'/>&nbsp;</td>
				<td><c:out value='${userinfo.pwd}'/>&nbsp;</td>
				<td><c:out value='${userinfo.email}'/>&nbsp;</td>
				<td><c:out value='${userinfo.realname}'/>&nbsp;</td>
				<td><c:out value='${userinfo.gender}'/>&nbsp;</td>
				<td><c:out value='${userinfo.question}'/>&nbsp;</td>
				<td><c:out value='${userinfo.answer}'/>&nbsp;</td>
				<td><c:out value='${userinfo.phone}'/>&nbsp;</td>
				<td><c:out value='${userinfo.mypage}'/>&nbsp;</td>
				<td><c:out value='${userinfo.hobbies}'/>&nbsp;</td>
				<td><c:out value='${userinfo.selfintro}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/Userinfo/show.do?id=${userinfo.id}">查看</a>&nbsp;&nbsp;
					<a href="${ctx}/Userinfo/edit.do?id=${userinfo.id}">修改</a>&nbsp;&nbsp;
				</td>
			  </tr>
			  
		  	  </c:forEach>
		  </tbody>
		</table>
		<p style="margin: 10px 0;">
		<!-- 分页区域 -->
		<simpletable:pageToolbar page="${page}"></simpletable:pageToolbar>
		<!-- 分页区域 结束 -->
	</div>
	<!-- 数据区域  结束-->
	</form>
</body>
</html>

